import { http } from "../utils/http";

/** 获取货物列表 */
export const getWarehousingList = params => {
  return http.request("get", "/v1/get_cargo_page", { params });
};

/** 创建入库清单 */
export const createWarehousing = data => {
  return http.request("post", "/v1/create_checkin_task", { data });
};

/** 修改入库清单 */
export const modifyWarehousing = data => {
  return http.request("post", "/v1/modify_checkin_task", { data });
};

/** 获取所有服务列表 */
export const getServiceList = (params?: object) => {
  return http.request("get", "/v1/get_service_list", { params });
};

/** 获取所有出库方式 */
export const getCheckoutList = () => {
  return http.request("get", "/v1/get_checkout_list");
};

/** 获取所有出库方式 */
export const getCargoList = () => {
  return http.request("get", "/v1/get_cargo_list");
};

/** 出库 */
export const warehouseOut = data => {
  return http.request("post", "/v1/warehouse_out", { data });
};

/** 创建入库子清单 */
export const createCheckinSubtasks = data => {
  return http.request("post", "/v1/create_checkin_subtasks", { data });
};

/** 修改入库子清单 */
export const modifyCheckinSubtasks = data => {
  return http.request("post", "/v1/modify_checkin_subtasks", { data });
};

/** 暂扣 */
export const temporaryStorage = data => {
  return http.request("post", "/v1/temporary_storage", { data });
};

/** 添加费用 */
export const addFee = data => {
  return http.request("post", "/v1/add_fee", { data });
};

/** 完成出库子任务 */
export const complete = data => {
  return http.request("post", "/v1/complete_warehouse_out_subtask", { data });
};

/** 添加出库清单任务规划时间 */
export const addPlanningTime = data => {
  return http.request("post", "/v1/add_warehouse_out_planning_time", { data });
};

export const importExcel = data => {
  return http.request("post", "/v1/import_excel", { data });
};

export const getCargoServiceList = params => {
  return http.request("get", "/v1/get_cargo_service_list", { params });
};

export const delCheckinTasks = data => {
  return http.request("post", "/v1/del_checkin_task", { data });
};

export const delCheckinSubTasks = data => {
  return http.request("post", "/v1/del_checkin_subtasks", { data });
};
